Optimal. Leaf size=185 \[ -\frac {a^2 \log (\cos (c+d x))}{d}+\frac {2 a b \sec (c+d x)}{d}-\frac {2 a^2 \sec ^2(c+d x)}{d}-\frac {8 a b \sec ^3(c+d x)}{3 d}+\frac {3 a^2 \sec ^4(c+d x)}{2 d}+\frac {12 a b \sec ^5(c+d x)}{5 d}-\frac {2 a^2 \sec ^6(c+d x)}{3 d}-\frac {8 a b \sec ^7(c+d x)}{7 d}+\frac {a^2 \sec ^8(c+d x)}{8 d}+\frac {2 a b \sec ^9(c+d x)}{9 d}+\frac {b^2 \tan ^{10}(c+d x)}{10 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.09, antiderivative size = 217, normalized size of antiderivative = 1.17, number of steps
used = 3, number of rules used = 2, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {3970, 962}
\begin {gather*} \frac {\left (a^2-4 b^2\right ) \sec ^8(c+d x)}{8 d}-\frac {\left (2 a^2-3 b^2\right ) \sec ^6(c+d x)}{3 d}+\frac {\left (3 a^2-2 b^2\right ) \sec ^4(c+d x)}{2 d}-\frac {\left (4 a^2-b^2\right ) \sec ^2(c+d x)}{2 d}-\frac {a^2 \log (\cos (c+d x))}{d}+\frac {2 a b \sec ^9(c+d x)}{9 d}-\frac {8 a b \sec ^7(c+d x)}{7 d}+\frac {12 a b \sec ^5(c+d x)}{5 d}-\frac {8 a b \sec ^3(c+d x)}{3 d}+\frac {2 a b \sec (c+d x)}{d}+\frac {b^2 \sec ^{10}(c+d x)}{10 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 962
Rule 3970
Rubi steps
\begin {align*} \int (a+b \sec (c+d x))^2 \tan ^9(c+d x) \, dx &=\frac {\text {Subst}\left (\int \frac {(a+x)^2 \left (b^2-x^2\right )^4}{x} \, dx,x,b \sec (c+d x)\right )}{b^8 d}\\ &=\frac {\text {Subst}\left (\int \left (2 a b^8+\frac {a^2 b^8}{x}-b^6 \left (4 a^2-b^2\right ) x-8 a b^6 x^2+2 b^4 \left (3 a^2-2 b^2\right ) x^3+12 a b^4 x^4-2 b^2 \left (2 a^2-3 b^2\right ) x^5-8 a b^2 x^6+\left (a^2-4 b^2\right ) x^7+2 a x^8+x^9\right ) \, dx,x,b \sec (c+d x)\right )}{b^8 d}\\ &=-\frac {a^2 \log (\cos (c+d x))}{d}+\frac {2 a b \sec (c+d x)}{d}-\frac {\left (4 a^2-b^2\right ) \sec ^2(c+d x)}{2 d}-\frac {8 a b \sec ^3(c+d x)}{3 d}+\frac {\left (3 a^2-2 b^2\right ) \sec ^4(c+d x)}{2 d}+\frac {12 a b \sec ^5(c+d x)}{5 d}-\frac {\left (2 a^2-3 b^2\right ) \sec ^6(c+d x)}{3 d}-\frac {8 a b \sec ^7(c+d x)}{7 d}+\frac {\left (a^2-4 b^2\right ) \sec ^8(c+d x)}{8 d}+\frac {2 a b \sec ^9(c+d x)}{9 d}+\frac {b^2 \sec ^{10}(c+d x)}{10 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.46, size = 173, normalized size = 0.94 \begin {gather*} \frac {-2520 a^2 \log (\cos (c+d x))+5040 a b \sec (c+d x)-1260 \left (4 a^2-b^2\right ) \sec ^2(c+d x)-6720 a b \sec ^3(c+d x)+1260 \left (3 a^2-2 b^2\right ) \sec ^4(c+d x)+6048 a b \sec ^5(c+d x)-840 \left (2 a^2-3 b^2\right ) \sec ^6(c+d x)-2880 a b \sec ^7(c+d x)+315 \left (a^2-4 b^2\right ) \sec ^8(c+d x)+560 a b \sec ^9(c+d x)+252 b^2 \sec ^{10}(c+d x)}{2520 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.19, size = 224, normalized size = 1.21
method | result | size |
derivativedivides | \(\frac {\frac {b^{2} \left (\sin ^{10}\left (d x +c \right )\right )}{10 \cos \left (d x +c \right )^{10}}+2 b a \left (\frac {\sin ^{10}\left (d x +c \right )}{9 \cos \left (d x +c \right )^{9}}-\frac {\sin ^{10}\left (d x +c \right )}{63 \cos \left (d x +c \right )^{7}}+\frac {\sin ^{10}\left (d x +c \right )}{105 \cos \left (d x +c \right )^{5}}-\frac {\sin ^{10}\left (d x +c \right )}{63 \cos \left (d x +c \right )^{3}}+\frac {\sin ^{10}\left (d x +c \right )}{9 \cos \left (d x +c \right )}+\frac {\left (\frac {128}{35}+\sin ^{8}\left (d x +c \right )+\frac {8 \left (\sin ^{6}\left (d x +c \right )\right )}{7}+\frac {48 \left (\sin ^{4}\left (d x +c \right )\right )}{35}+\frac {64 \left (\sin ^{2}\left (d x +c \right )\right )}{35}\right ) \cos \left (d x +c \right )}{9}\right )+a^{2} \left (\frac {\left (\tan ^{8}\left (d x +c \right )\right )}{8}-\frac {\left (\tan ^{6}\left (d x +c \right )\right )}{6}+\frac {\left (\tan ^{4}\left (d x +c \right )\right )}{4}-\frac {\left (\tan ^{2}\left (d x +c \right )\right )}{2}-\ln \left (\cos \left (d x +c \right )\right )\right )}{d}\) | \(224\) |
default | \(\frac {\frac {b^{2} \left (\sin ^{10}\left (d x +c \right )\right )}{10 \cos \left (d x +c \right )^{10}}+2 b a \left (\frac {\sin ^{10}\left (d x +c \right )}{9 \cos \left (d x +c \right )^{9}}-\frac {\sin ^{10}\left (d x +c \right )}{63 \cos \left (d x +c \right )^{7}}+\frac {\sin ^{10}\left (d x +c \right )}{105 \cos \left (d x +c \right )^{5}}-\frac {\sin ^{10}\left (d x +c \right )}{63 \cos \left (d x +c \right )^{3}}+\frac {\sin ^{10}\left (d x +c \right )}{9 \cos \left (d x +c \right )}+\frac {\left (\frac {128}{35}+\sin ^{8}\left (d x +c \right )+\frac {8 \left (\sin ^{6}\left (d x +c \right )\right )}{7}+\frac {48 \left (\sin ^{4}\left (d x +c \right )\right )}{35}+\frac {64 \left (\sin ^{2}\left (d x +c \right )\right )}{35}\right ) \cos \left (d x +c \right )}{9}\right )+a^{2} \left (\frac {\left (\tan ^{8}\left (d x +c \right )\right )}{8}-\frac {\left (\tan ^{6}\left (d x +c \right )\right )}{6}+\frac {\left (\tan ^{4}\left (d x +c \right )\right )}{4}-\frac {\left (\tan ^{2}\left (d x +c \right )\right )}{2}-\ln \left (\cos \left (d x +c \right )\right )\right )}{d}\) | \(224\) |
risch | \(i a^{2} x +\frac {2 i a^{2} c}{d}+\frac {4 b a \,{\mathrm e}^{19 i \left (d x +c \right )}-8 a^{2} {\mathrm e}^{18 i \left (d x +c \right )}+2 b^{2} {\mathrm e}^{18 i \left (d x +c \right )}+\frac {44 b a \,{\mathrm e}^{17 i \left (d x +c \right )}}{3}-40 a^{2} {\mathrm e}^{16 i \left (d x +c \right )}+\frac {1072 b a \,{\mathrm e}^{15 i \left (d x +c \right )}}{15}-\frac {368 a^{2} {\mathrm e}^{14 i \left (d x +c \right )}}{3}+24 b^{2} {\mathrm e}^{14 i \left (d x +c \right )}+\frac {880 b a \,{\mathrm e}^{13 i \left (d x +c \right )}}{7}-\frac {680 a^{2} {\mathrm e}^{12 i \left (d x +c \right )}}{3}+\frac {12616 b a \,{\mathrm e}^{11 i \left (d x +c \right )}}{63}-272 a^{2} {\mathrm e}^{10 i \left (d x +c \right )}+\frac {252 b^{2} {\mathrm e}^{10 i \left (d x +c \right )}}{5}+\frac {12616 b a \,{\mathrm e}^{9 i \left (d x +c \right )}}{63}-\frac {680 a^{2} {\mathrm e}^{8 i \left (d x +c \right )}}{3}+\frac {880 b a \,{\mathrm e}^{7 i \left (d x +c \right )}}{7}-\frac {368 a^{2} {\mathrm e}^{6 i \left (d x +c \right )}}{3}+24 b^{2} {\mathrm e}^{6 i \left (d x +c \right )}+\frac {1072 b a \,{\mathrm e}^{5 i \left (d x +c \right )}}{15}-40 a^{2} {\mathrm e}^{4 i \left (d x +c \right )}+\frac {44 b a \,{\mathrm e}^{3 i \left (d x +c \right )}}{3}-8 a^{2} {\mathrm e}^{2 i \left (d x +c \right )}+2 b^{2} {\mathrm e}^{2 i \left (d x +c \right )}+4 b a \,{\mathrm e}^{i \left (d x +c \right )}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{10}}-\frac {a^{2} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}\) | \(384\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.27, size = 174, normalized size = 0.94 \begin {gather*} -\frac {2520 \, a^{2} \log \left (\cos \left (d x + c\right )\right ) - \frac {5040 \, a b \cos \left (d x + c\right )^{9} - 6720 \, a b \cos \left (d x + c\right )^{7} - 1260 \, {\left (4 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{8} + 6048 \, a b \cos \left (d x + c\right )^{5} + 1260 \, {\left (3 \, a^{2} - 2 \, b^{2}\right )} \cos \left (d x + c\right )^{6} - 2880 \, a b \cos \left (d x + c\right )^{3} - 840 \, {\left (2 \, a^{2} - 3 \, b^{2}\right )} \cos \left (d x + c\right )^{4} + 560 \, a b \cos \left (d x + c\right ) + 315 \, {\left (a^{2} - 4 \, b^{2}\right )} \cos \left (d x + c\right )^{2} + 252 \, b^{2}}{\cos \left (d x + c\right )^{10}}}{2520 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.47, size = 181, normalized size = 0.98 \begin {gather*} -\frac {2520 \, a^{2} \cos \left (d x + c\right )^{10} \log \left (-\cos \left (d x + c\right )\right ) - 5040 \, a b \cos \left (d x + c\right )^{9} + 6720 \, a b \cos \left (d x + c\right )^{7} + 1260 \, {\left (4 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{8} - 6048 \, a b \cos \left (d x + c\right )^{5} - 1260 \, {\left (3 \, a^{2} - 2 \, b^{2}\right )} \cos \left (d x + c\right )^{6} + 2880 \, a b \cos \left (d x + c\right )^{3} + 840 \, {\left (2 \, a^{2} - 3 \, b^{2}\right )} \cos \left (d x + c\right )^{4} - 560 \, a b \cos \left (d x + c\right ) - 315 \, {\left (a^{2} - 4 \, b^{2}\right )} \cos \left (d x + c\right )^{2} - 252 \, b^{2}}{2520 \, d \cos \left (d x + c\right )^{10}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 3.28, size = 314, normalized size = 1.70 \begin {gather*} \begin {cases} \frac {a^{2} \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac {a^{2} \tan ^{8}{\left (c + d x \right )}}{8 d} - \frac {a^{2} \tan ^{6}{\left (c + d x \right )}}{6 d} + \frac {a^{2} \tan ^{4}{\left (c + d x \right )}}{4 d} - \frac {a^{2} \tan ^{2}{\left (c + d x \right )}}{2 d} + \frac {2 a b \tan ^{8}{\left (c + d x \right )} \sec {\left (c + d x \right )}}{9 d} - \frac {16 a b \tan ^{6}{\left (c + d x \right )} \sec {\left (c + d x \right )}}{63 d} + \frac {32 a b \tan ^{4}{\left (c + d x \right )} \sec {\left (c + d x \right )}}{105 d} - \frac {128 a b \tan ^{2}{\left (c + d x \right )} \sec {\left (c + d x \right )}}{315 d} + \frac {256 a b \sec {\left (c + d x \right )}}{315 d} + \frac {b^{2} \tan ^{8}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}}{10 d} - \frac {b^{2} \tan ^{6}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}}{10 d} + \frac {b^{2} \tan ^{4}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}}{10 d} - \frac {b^{2} \tan ^{2}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}}{10 d} + \frac {b^{2} \sec ^{2}{\left (c + d x \right )}}{10 d} & \text {for}\: d \neq 0 \\x \left (a + b \sec {\left (c \right )}\right )^{2} \tan ^{9}{\left (c \right )} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 489 vs.
\(2 (169) = 338\).
time = 6.35, size = 489, normalized size = 2.64 \begin {gather*} \frac {2520 \, a^{2} \log \left ({\left | -\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} + 1 \right |}\right ) - 2520 \, a^{2} \log \left ({\left | -\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} - 1 \right |}\right ) + \frac {7381 \, a^{2} + 4096 \, a b + \frac {78850 \, a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {40960 \, a b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {382545 \, a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {184320 \, a b {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {1114200 \, a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {491520 \, a b {\left (\cos \left (d x + c\right ) - 1\right )}^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {2171610 \, a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} + \frac {860160 \, a b {\left (\cos \left (d x + c\right ) - 1\right )}^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} + \frac {2736972 \, a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}} + \frac {516096 \, a b {\left (\cos \left (d x + c\right ) - 1\right )}^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}} - \frac {258048 \, b^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}} + \frac {2171610 \, a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{6}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{6}} + \frac {1114200 \, a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{7}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{7}} + \frac {382545 \, a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{8}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{8}} + \frac {78850 \, a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{9}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{9}} + \frac {7381 \, a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{10}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{10}}}{{\left (\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} + 1\right )}^{10}}}{2520 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 5.07, size = 344, normalized size = 1.86 \begin {gather*} \frac {\frac {512\,a\,b}{315}+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (20\,a^2+\frac {512\,b\,a}{7}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (2\,a^2+\frac {1024\,b\,a}{63}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8\,\left (\frac {740\,a^2}{3}+\frac {1024\,b\,a}{3}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (\frac {272\,a^2}{3}+\frac {4096\,b\,a}{21}\right )+\frac {740\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{12}}{3}-\frac {272\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{14}}{3}+20\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{16}-2\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{18}-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}\,\left (348\,a^2+\frac {1024\,a\,b}{5}-\frac {512\,b^2}{5}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{20}-10\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{18}+45\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{16}-120\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{14}+210\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{12}-252\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+210\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-120\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+45\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-10\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}+\frac {2\,a^2\,\mathrm {atanh}\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________